import java.awt.BorderLayout;
import java.awt.Container;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;

import javax.swing.AbstractAction;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.JTextField;


public class Window extends JFrame{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	public static void main(String[] args) {
		new Window().setVisible(true);
	}

	AbstractAction action = new DataParseAction();
	
	Container c;
	static JTextField inputField = new JTextField(30);
	static JTextField inputField2 = new JTextField(30);

	static JTextArea outputField = new JTextArea();

	JScrollPane outputFieldScrollPane = new JScrollPane(outputField);

	JPanel inputPanel = new JPanel();
	JPanel outputPanel = new JPanel();

	//constructor
	Window(){
		c = getContentPane();
		setBounds(10, 10, 400, 400);
		setLayout(new BorderLayout());
		inputPanel.setLayout(new BorderLayout());
		outputPanel.setLayout(new BorderLayout());

		inputPanel.add(inputField, BorderLayout.NORTH);
		inputPanel.add(inputField2, BorderLayout.CENTER);

		outputPanel.add(outputFieldScrollPane, BorderLayout.CENTER);

		c.add(inputPanel, BorderLayout.NORTH);
		c.add(outputPanel, BorderLayout.CENTER);

		inputField.addActionListener(action);

		addWindowListener(new WindowListener() {

			@Override
			public void windowOpened(WindowEvent arg0) {}

			@Override
			public void windowIconified(WindowEvent arg0) {}

			@Override
			public void windowDeiconified(WindowEvent arg0) {}

			@Override
			public void windowDeactivated(WindowEvent arg0) {}

			@Override
			public void windowClosing(WindowEvent arg0) {
				System.exit(0);
			}

			@Override
			public void windowClosed(WindowEvent arg0) {}

			@Override
			public void windowActivated(WindowEvent arg0) {}
		});
	}





}
